<template>
  <div class="home">
    <custom :title="isSuccess?'支付成功':'支付失败'" />
    <div>
      <div v-if="type">
        <img v-if="isSuccess" src="@/assets/paySuccess/vipCard.png" alt="" class="payImg" />
        <img v-else src="@/assets/paySuccess/vipCardFail.png" alt="" class="payImg" />
      </div>
      <div v-else>
        <img v-if="isSuccess" src="@/assets/paySuccess/vipCardOne.png" alt="" class="payImg" />
        <img v-else src="@/assets/paySuccess/fail.png" alt="" class="payImg" />
      </div>
      <div :class="['payTit', type?'payTitAct':'']">{{ isSuccess?'支付成功':'支付失败' }}</div>
      <div v-if="isSuccess">
        <div class="payTitle">家有福利社</div>
        <div class="payPiceBox">¥<span class="payPice">0.01</span></div>
      </div>
      <div v-else>
        <div class="payTitle">余额不足</div>
        <div class="payPiceBox">--</div>
      </div>
      <div v-show="type">
        <div v-if="isSuccess" class="payYPice">已为您优惠¥1.00</div>
        <img src="@/assets/paySuccess/vipLine.png" alt="" class="vipLine" />
        <div class="payOrder">
          <div class="flex justify-sb payOrderOne">
            <div>订单金额</div>
            <div class="payOrderPrice">{{ isSuccess?'¥1.01':'--' }}</div>
          </div>
          <div class="flex justify-sb">
            <div>储蓄余额</div>
            <div class="payOrderPrice">{{ isSuccess?'¥1.01':'--' }}</div>
          </div>
        </div>
      </div>
    </div>
    <div class="buttonBox">
      <div :class="['button', type?'buttonAct':'']">{{ type?isSuccess?'完成':'返回':'返回' }}</div>
    </div>
  </div>
</template>

<script>
import custom from '@/components/custom.vue'
export default {
  components: {
    custom
  },
  data() {
    return {
      type: 1,
      isSuccess: true
    }
  },
  created() {
  },
  mounted() {
    // 接参
    this.type = Number(this.$route.query.type)
  },
  methods: {
  }
}
</script>

<style scoped>
.payImg{
  width: 180px;
  height: 180px;
  display: block;
  margin: 40px auto 0;
}
.payTit{
  font-size: 30px;
  color: #12A823;
  text-align: center;
}
.payTitAct{
  color: #F35517;
}
.payTitle{
  font-size: 30px;
  color: #000000;
  text-align: center;
  margin: 110px 0 38px;
}
.payPiceBox{
  font-size: 34px;
  font-weight: 600;
  color: #000000;
  text-align: center;
}
.payPice{
  font-size: 44px;
}
.payYPice{
  text-align: center;
  color: #8B8B8B;
  font-size: 26px;
  margin-top: 32px;
}
.vipLine{
  height: 100px;
  width: 750px;
  margin-top: 142px;
  display: block;
}
.payOrder{
  padding: 0 58px;
  color: #8B8B8B;
  font-size: 28px;
}
.payOrderOne{
  margin: 40px 0;
}
.payOrderPrice{
  font-size: 28px;
  font-weight: 600;
  color: #000000;
}
.buttonBox{
  width: 100%;
  /* position: fixed;
  bottom: 50px; */
  margin-top: 40px;
}
.button{
  width: 510px;
  height: 80px;
  line-height: 80px;
  background: #FFFFFF;
  border: 1px solid #27AE35;
  border-radius: 16px;
  text-align: center;
  color: #27AE35;
  margin: 0 auto;
  font-size: 30px;
}
.buttonAct{
  border: 1px solid #F35517;
  color: #F35517;
}
</style>
